package com.systemmanger.service;

import com.bean.WmsTPermission;
import com.systemmanger.mapper.PermMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @AUTHOR(闫晨航)
 * @date2021-12-08 14:05
 */
@Service
public class PermService {
    @Autowired
    PermMapper permMapper;

    public List<WmsTPermission> getAllPerms() {
        return permMapper.getAllPerms();
    }

    public List<WmsTPermission> getPerms(Map<String, Object> map) {
        return permMapper.getPerms(map);
    }

    public String getGroupid(String permId) {
        return permMapper.getGroupid(permId);
    }
    @Transactional
    public void updateIsDel(String permId,String groupId){
        permMapper.updateUser(groupId);
        permMapper.updateGroup(permId);
        permMapper.updatePerm(permId);
    }
}
